**MAIN REGRESSIONS

gen aidXcontest= Intventamtcum1*OppConflict

***Main Table
eststo clear
eststo: quietly areg LCcomposite Intventamtcum1 aidXcontest OppConflict  surveydum*, a(Location2) robust cluster(Location2)
eststo: quietly areg LCcomposite Intventamtcum1 aidXcontest OppConflict ISIS JANAAS FSA Polarity Age education Gender MuslimSunniArab MuslimSunniKurd surveydum*, a(Location2) robust cluster(Location2)
esttab using main.tex, starlevels( * 0.10 ** 0.05 *** 0.010) se b(3) pr2 replace label nogap nonumbers booktabs alignment(D{.}{.}{-1}) title(OLS Regression Results \label{tab:tab5})
 

***Figure 1 
areg LCcomposite c.Intventamtcum1##OppConflict  surveydum*, a(Location2) robust cluster(Location2)

margins, dydx(Intventamtcum1) over(OppConflict) 

gen x = _n

gen y =   .0134083   if x == 1 /* ISIS 0 */
replace y =  .0048505   if x == 2 /* ISIS 1 */

gen y1_se = .0030987
gen y2_se = .0044137 


gen yu =   1.645*y1_se + y  if x == 1
replace yu = 1.645*y2_se + y if x == 2

gen yl =   -1.645*y1_se + y  if x == 1
replace yl = -1.645*y2_se + y if x == 2


keep if x < 3
 
 
label define label_x 1  "Non-contested areas"  2 "Contested areas" 
label value x label_x

twoway (scatter y x, mcolor(gs4)) (rcap yu  yl x, lcolor(gs4)), yline(0, lcolor(gs12)) ///
legend(off)  xlabel(1  "Non-contested areas"  2 "Contested areas" , valuelabel noticks) ///
scheme(s1mono) ytitle(Margina Effects of Aid) xmtick(0.5(1)2.5, nolabels noticks) xsize(6) ysize(6) ///
xtitle("") 

graph export "MarginalPlot2.pdf", replace



